package returntype;

import java.lang.reflect.Method;

class Person  {
    private String name;
    private String gender;
    private String birthday;

    private Person() {
    }

    public Person(String name){
        this.name = name;
    }

    public Person(String name, String gender, String birthday) {
        this.name = name;
        this.gender = gender;
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    private void secrete(String content) {
        System.out.println("Show secrete is : " + content);
    }

    protected void sayHello(String msg) {
        System.out.println("hello," + msg);
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", birthday='" + birthday + '\'' +
                '}';
    }

}
public class ReflectReturnTypeDemo {

    public static void main(String[] args) throws Exception{
        Class clazz = Class.forName("returntype.Person");
        Method method = clazz.getDeclaredMethod("getName");
        Class returnType =  method.getReturnType();
        System.out.println(returnType.toGenericString());
    }
}
